Skip to content

Commit e96f358

Browse files
authored
Merge pull request #6636 from emilghittasv/playwright-add-tests
Playwright add test coverage for 2183
2 parents d7ba74f + 5eb6771 commit e96f358

File tree

1 file changed

+81
-0
lines changed

1 file changed

+81
-0
lines changed

playwright_tests/tests/explore_help_articles_tests/articles/test_article_translation.py

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -388,3 +388,84 @@ def test_sumo_locale_priority(page: Page):
388388
utilities.set_extra_http_headers(headers)
389389
utilities.navigate_to_link(HomepageMessages.STAGE_HOMEPAGE_URL)
390390
expect(page).to_have_url(HomepageMessages.STAGE_HOMEPAGE_URL + "/de/")
391+
392+
393+
# C3016012
394+
@pytest.mark.kbArticleTranslation
395+
def test_topic_inheritance_from_parent(page: Page):
396+
utilities = Utilities(page)
397+
sumo_pages = SumoPages(page)
398+
original_topic_listing_page = "https://support.allizom.org/ro/products/firefox/accounts"
399+
new_topic_listing_page = ("https://support.allizom.org/ro/products/firefox/settings/"
400+
"customization")
401+
402+
with allure.step("Signing in with an Admin account"):
403+
utilities.start_existing_session(utilities.username_extraction_from_email(
404+
utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
405+
))
406+
407+
with allure.step("Create a new simple article and approving it without marking it as "
408+
"ready for localization"):
409+
sumo_pages.submit_kb_article_flow.submit_simple_kb_article(approve_first_revision=True)
410+
parent_article_url = utilities.get_page_url()
411+
412+
with allure.step("Creating a new translation in the ro locale"):
413+
sumo_pages.kb_article_page.click_on_translate_article_option()
414+
sumo_pages.translate_article_page.click_on_locale_from_list("ro")
415+
translation = sumo_pages.submit_kb_translation_flow._add_article_translation(
416+
approve_translation_revision=True)
417+
418+
with check, allure.step("Navigating to the topic listing page and verifying that the "
419+
"translation is successfully displayed"):
420+
utilities.navigate_to_link(original_topic_listing_page)
421+
expect(sumo_pages.product_topics_page.get_a_particular_article_locator(
422+
translation['translation_title'])).to_be_visible()
423+
424+
with allure.step("Navigating to the parent article and editing it's metadata by adding a new "
425+
"topic"):
426+
utilities.navigate_to_link(parent_article_url)
427+
sumo_pages.edit_article_metadata_flow._edit_article_metadata(
428+
topics=["Settings", "Customization"]
429+
)
430+
431+
with check, allure.step("Navigating to the first topic listing page and verifying that the "
432+
"translations is successfully displayed"):
433+
utilities.navigate_to_link(original_topic_listing_page)
434+
expect(sumo_pages.product_topics_page.get_a_particular_article_locator(
435+
translation['translation_title'])).to_be_visible()
436+
437+
with check, allure.step("Navigating to the new topic listing page and verifying that the "
438+
"translations is successfully displayed"):
439+
utilities.navigate_to_link(new_topic_listing_page)
440+
expect(sumo_pages.product_topics_page.get_a_particular_article_locator(
441+
translation['translation_title'])).to_be_visible()
442+
443+
with allure.step("Removing the old topic from the parent article"):
444+
utilities.navigate_to_link(parent_article_url)
445+
sumo_pages.edit_article_metadata_flow._edit_article_metadata(topics="Accounts")
446+
447+
with check, allure.step("Navigating to the first topic listing page and verifying that the "
448+
"translation is not displayed"):
449+
utilities.navigate_to_link(original_topic_listing_page)
450+
expect(sumo_pages.product_topics_page.get_a_particular_article_locator(
451+
translation['translation_title'])).to_be_hidden()
452+
453+
with check, allure.step("Navigating to the new topic listing page and verifying that the "
454+
"translation is displayed"):
455+
utilities.navigate_to_link(new_topic_listing_page)
456+
expect(sumo_pages.product_topics_page.get_a_particular_article_locator(
457+
translation['translation_title'])).to_be_visible()
458+
459+
with allure.step("Deleting the parent article"):
460+
utilities.navigate_to_link(parent_article_url)
461+
sumo_pages.kb_article_deletion_flow.delete_kb_article()
462+
463+
with allure.step("Verifying that the translation is not visible in both the original and new "
464+
"topic listing pages"):
465+
utilities.navigate_to_link(original_topic_listing_page)
466+
expect(sumo_pages.product_topics_page.get_a_particular_article_locator(
467+
translation['translation_title'])).to_be_hidden()
468+
469+
utilities.navigate_to_link(new_topic_listing_page)
470+
expect(sumo_pages.product_topics_page.get_a_particular_article_locator(
471+
translation['translation_title'])).to_be_hidden()

0 commit comments

Comments
 (0)